home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1994 November / Cd Ware (Nro. 2) - Epimundo.iso / DOS / UD / CRUSH.ZIP / CRUSH.DOC < prev    next >
Encoding:
Text File  |  1994-06-01  |  5.6 KB  |  124 lines

  1.  
  2.  
  3.  
  4.  
  5.                       CRUSH and UNCRUSH documentation
  6.  
  7.                       Versions
  8.                          CRUSH   : 0.81
  9.                          UNCRUSH : 0.61
  10.  
  11.                       First Public Release
  12.                       Designed and created by Bill Davidson
  13.  
  14.  
  15.  
  16.  
  17. DISCLAIMER :   
  18.    This is free. You may distribute this program as long as both the source
  19.    code and the compiled CRUSH and UNCRUSH and this documentation are
  20.    included. This software is basically just for learning purposes. You
  21.    may edit it but please include the original files with your own. Most
  22.    importantly, DISTRIBUTE! The author of these programs is not responsible 
  23.    for any damage to anything or anyone as a result of using this program. 
  24.    In other words, leave me out!
  25.  
  26.          IMPORTANT :
  27.  
  28.  In order for this program to run, the desired file to be compressed must
  29. be called "q.q". The reason for that is I really didn't want to mess with
  30. accepting parameters from the command line with the limited time I had to 
  31. create this program (This was originally made for the 1994 science fairs.)
  32. The output file is called "w.w". When uncompressing, the input file must be 
  33. called "w.w" and the output file is called "e.e". I chose these unique file
  34. names, because I had nothing better to call them.
  35.  Also, this compression program will only execute on text files. The reason
  36. is as follows: In my compression program, it doesn't open files in binary 
  37. mode and it looks for an end-of-file marker. In compiled files, such as
  38. executables and spreadsheet files, eof markers are everywhere, so it ends
  39. up compressing 512 bytes of a 100 K file. You can try it if you like. All it
  40. executes on is ASCII text. It can be extended ASCII, but it can't be 
  41. compiled.
  42.  For my science fair, I tested this program against 9 other commercial
  43. data compression programs: AR002, ARJ241, HPACK, LARC333, LZHUFT, PAK251,
  44. PKZIP204g, SQZ1083, and ZOO210. My study and the results of it will be 
  45. released at a later date (hopefully in a month.)
  46.  
  47.          
  48.          How it Works
  49.  
  50.  The compression engine used in CRUSH is ASCII text replacement. It uses a 
  51. preset dictionary that contains the strings it looks for. The strings were
  52. derived from James A. Storer's book, DATA COMPRESSION : METHODS AND THEORIES.
  53.  
  54.  The compression program reads a line from the input file and turns it into
  55. a string. Then It searches the line for header characters. If it finds one,
  56. then it doubles it. This is important because my decompression program 
  57. looks for header characters to decode. If there is a header character in the
  58. original file and my compression program doesn't do anything with it, the my 
  59. decompression program will try to uncode something that isn't supposed to 
  60. by uncoded. Once it is done, then, starting with the 8 letter arrays down to 
  61. the 3 letter arrays, it searches for the strings in the arrays in the modified
  62. line-string. If it finds one, it deletes the string and assigns a header 
  63. character, there is one for each of the letter arrays, and a code character. 
  64. The code character is assembled using the position of the replacement string 
  65. in the array found, adding 145, and taking the cooresponding ASCII character. 
  66. By adding 145, it gets the characters out of the 0 to 31 ASCII set that DOS 
  67. uses and before my header characters. After it is done with that coding, it 
  68. moves past that replaced string and on down the line-string. When it reaches 
  69. the end of the line, it writes that line to the output file and reads the 
  70. next line of the input file. Once it reaches the end-of-file marker, it 
  71. saves the ouput file and quits.
  72.  
  73.  Uncoding is quite simple. It reads a coded line and turns it into a string.
  74. It then searches for the header characters. If it finds one, then it checks
  75. the character after it. If it is the same character as the header character,
  76. then it deletes one and moves on. If it isn't, then it gets the ordinal value
  77. for that character and subtracts 145, the offset number. Then it finds the
  78. cooresponding string with that number, deletes the header character and
  79. the code character and inserts the string from the array. Then it moves down
  80. the line. Once it reaches the end of the line, it writes that line-string to
  81. the output file. Once it reaches the end of the file, it saves the output file
  82. and quits.
  83.  
  84.                 
  85.    If you want to get in touch with me you can
  86.  
  87.       write :    Bill Davidson
  88.                  1811 S. 73rd Circle
  89.                  Fort Smith, AR 72903
  90.  
  91.       call  :    (501)452-7043
  92.  
  93.       send  :    Write mail to all in the Data Compression forum on
  94.                  Compuserve, or send a private letter to my dad on
  95.                  his account number : 73361,1217
  96.  
  97.      
  98.      or call any of these BBS's that I call frequently in Fort Smith and
  99.      leave me a message :
  100.  
  101.          Paradox of Arkansas       484-0944
  102.                                    484-1043
  103.          AR/OK PC Users Group      646-0543
  104.          The Serial Connection     785-2408
  105.                                    785-2477
  106.          Realms of Thunder         484-0884
  107.  
  108.  
  109. These numbers are valid as of June, 1994 
  110.  
  111.  
  112.  If you do decide to modify this file, please notify me through one of these
  113. sources. Contact me if you have any info on data compression program
  114. writing. I am currently looking for an idea next year revolving around this,
  115. so if you have an idea, tell me.
  116.  Please do not critize me for bad code writing or such. I am only a 2 year
  117. programmer and leaving Pascal for C++ and Assembly...
  118.  
  119.    Have fun. Hope it sparks some ideas for you!
  120.  
  121.          Bill Davidson
  122.     
  123.  
  124.